<template>
	<view class="main">
		<view class="content">
			<image class="icon" v-if="payStatus == 1" src="/static/img/my/success_pay.png" mode="scaleToFill" />
			<image class="icon" v-else src="/static/img/my/lose_pay.png" mode="scaleToFill" />
			<view class="fz30">{{ payStatus ? '付款成功' : '付款失败，请稍后重试' }}</view>
		</view>
		<view class="btn flex_center_align" @click="back">
			确认
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			payStatus: null,
			collegeId: null,
		}
	},
	methods: {
		back() {
			if (this.collegeId == undefined || this.collegeId == null || this.collegeId == "") {
				uni.navigateBack()
			} else {
				uni.redirectTo({
					url: '/school/courseInfo/index?id=' + this.collegeId
				})
			}
		},
	},
	onLoad(e) {
		let { payStatus, collegeId } = e
		this.payStatus = payStatus
		this.collegeId = collegeId
		uni.setNavigationBarTitle({
			title: this.payStatus ? '付款成功' : '付款失败'
		})
	}
}
</script>

<style lang="scss" scoped>
.main {
	position: relative;
	min-height: 100vh;
	background-color: #F9F7FC;
	padding: 0 30rpx;

	.content {
		padding-top: 112rpx;
		text-align: center;

		.icon {
			width: 120rpx;
			height: 120rpx;
			font-size: 120rpx;
			margin-bottom: 28rpx;
		}
	}

	.btn {
		font-size: 30rpx;
		width: 630rpx;
		height: 90rpx;
		background: #1C87F3;
		border-radius: 45rpx;
		margin: 100rpx auto 30rpx;
		color: #fff;
	}
}
</style>
